//
//  UIView+Convenience.m
//  QiaoRongJinFu
//
//  Created by JuFan  on 2017/2/15.
//  Copyright © 2017年 JuFan. All rights reserved.
//

#import "UIView+Convenience.h"

@implementation UIView (Convenience)

- (CGFloat)width
{
    return CGRectGetWidth(self.frame);
}
- (CGFloat)height
{
    return CGRectGetHeight(self.frame);
}
- (CGFloat)minX
{
    return CGRectGetMinX(self.frame);
}
- (CGFloat)midX
{
    return CGRectGetMidX(self.frame);
}
- (CGFloat)maxX
{
    return CGRectGetMaxX(self.frame);
}
- (CGFloat)minY
{
    
    return CGRectGetMinY(self.frame);
}
- (CGFloat)midY
{
    return CGRectGetMidY(self.frame);
}
- (CGFloat)maxY
{
    return CGRectGetMaxY(self.frame);
}

/**
 @return 高度值
 */
- (CGFloat)top_Height
{
    if ([self is_IphoneX]) {
        return 88;
    }else{
        return 64;
    }
}
- (CGFloat)topH{
    return [self top_Height];
}
- (CGFloat)bottemH{
    return [self bottem_Height];
}
/**
 底部高度值
 
 @return 高度值
 */
- (CGFloat)bottem_Height
{
    if ([self is_IphoneX]) {
        return 83;
    }else{
        return 49;
    }
}
/**
 判断是否是iPhone X
 
 @return  iPhone X 返回YES
 */
- (BOOL)is_IphoneX
{
    if ([UIScreen mainScreen].bounds.size.height == 812.0) {
        return YES;
    }else{
        return NO;
    }
}
@end
